Skip to content

fix: catch NotImplementedError in track and the hook lifecycle - #349

Merged
josecolella merged 1 commit into
mainfrom
fix/not-implemented-in-track-and-hooks
Oct 23, 2026
Merged

josecolella merged 1 commit into
mainfrom
fix/not-implemented-in-track-and-hooks

Conversation

@josecolella

Copy link
Copy Markdown
Collaborator

Summary

  • Completes fix: return defaults instead of raising from client calls #346's "client calls never raise" (spec 1.4.10) for NotImplementedError. Copilot found these gaps in review, and the fixes landed on the branch just after it merged, so they missed 0.6.7.
    • track now returns nil when the provider or the transaction-context propagator raises NotImplementedError.
    • With hooks registered, a provider's NotImplementedError now runs error hooks, and finally hooks get the default details. Before, error hooks were skipped and finally hooks got nil.
  • Interrupt and other non-StandardError exceptions still propagate.
  • Part of Spec v0.9.0 compliance #300.

🤖 Generated with Claude Code

track now returns nil for a provider or propagator that raises
NotImplementedError, and HookExecutor treats it like any other
evaluation error, so error hooks run and finally hooks get the default
details.

Signed-off-by: Jose Colella <jose.colella@gusto.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48708d85-b4ac-450b-98a3-de60d4505969
📥 Commits

Reviewing files that changed from the base of the PR and between c27ecb8 and bc66658.

📒 Files selected for processing: 4
  • lib/open_feature/sdk/client.rb
  • lib/open_feature/sdk/hooks/hook_executor.rb
  • spec/specification/flag_evaluation_api_spec.rb
  • spec/specification/tracking_spec.rb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (c27ecb8) to head (bc66658).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #349   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          32       32           
  Lines         879      879           
=======================================
  Hits          875      875           
  Misses          4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecolella
josecolella marked this pull request as ready for review October 23, 2026 16:19
@josecolella
josecolella requested a review from a team as a code owner October 23, 2026 16:19
Copilot AI balanced review requested due to automatic review settings October 23, 2026 16:19
@josecolella
josecolella merged commit 62759f4 into main Oct 23, 2026
28 checks passed
@josecolella
josecolella deleted the fix/not-implemented-in-track-and-hooks branch October 23, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrow rescue changes match the intended behavior and include targeted regression coverage, with no unresolved findings; tests were not executed.

No open issues 🎉

What changed in this PR

Closes the NotImplementedError handling gaps left after #346, extending the Ruby SDK’s non-raising client behavior.

Changes:

  • Makes track return nil when the provider or context builder raises NotImplementedError.
  • Routes NotImplementedError through error hooks and supplies default evaluation details to finally hooks.
  • Adds regression coverage while preserving propagation of unrelated exceptions such as Interrupt.
File Description
spec/​specification/​tracking_spec.rb Tests tracking with a provider that raises NotImplementedError.
spec/​specification/​flag_evaluation_api_spec.rb Tests error and finally hooks after a provider raises NotImplementedError.
lib/​open_feature/​sdk/​hooks/​hook_executor.rb Includes NotImplementedError in lifecycle error handling.
lib/​open_feature/​sdk/​client.rb Includes NotImplementedError in tracking error handling.

Review effort: Balanced

@josecolella josecolella mentioned this pull request Oct 23, 2026
17 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants